package com.gmail.wangzdl.swing.splashtest;



/*
 * SplashPanel.java
 *
 * Created on 2007��4��26��, ����11:22
 */

import java.awt.Color;
import java.awt.Font;
import java.util.StringTokenizer;

/**
 *
 * @author  William Chen
 */
public class SplashPanel extends javax.swing.JPanel{
    
    /** Creates new form SplashPanel */
    public SplashPanel() {
        initComponents();
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" ��ɵĴ��� ">                          
    private void initComponents() {
        lblMessage = new javax.swing.JLabel();
        pBar = new javax.swing.JProgressBar();

        lblMessage.setText("\u53d1\u73b0\u65b0\u7248\u672c\u7684\u8f6f\u4ef6\uff0c\u6b63\u5728\u5347\u7ea7\u4e2d\uff0c\u8bf7\u7a0d\u5019...");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(lblMessage, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
                    .addComponent(pBar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(250, Short.MAX_VALUE)
                .addComponent(lblMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
    }// </editor-fold>                        
    
    public void setMessage(String info) {
        lblMessage.setText(info);
    }

    public void setProgress(int percent) {
        pBar.setValue(percent);
    }
    
    public int getProgress() {
        return pBar.getValue();
    } 
    private javax.swing.JLabel lblMessage;
    private javax.swing.JProgressBar pBar;    
}

